
package org.come.Frame;

import com.tool.tcpimg.UIUtils;
import org.come.Jpanel.LingHelpListJpanel;
import org.come.Jpanel.SupportListJpanel;
import org.come.until.FormsManagement;
import org.come.until.Music;

import javax.swing.*;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

public class LingHelpListJframe extends JInternalFrame implements MouseListener {
	private LingHelpListJpanel lingHelpListJpanel = new LingHelpListJpanel();
	private int first_x;
	private int first_y;

	public static LingHelpListJframe getLingHelpListJframe() {
		return (LingHelpListJframe)FormsManagement.getInternalForm(622).getFrame();
	}

	public LingHelpListJframe() {
		this.getContentPane().add(this.lingHelpListJpanel);
		this.setBorder(BorderFactory.createEmptyBorder());
		((BasicInternalFrameUI)this.getUI()).setNorthPane((JComponent)null);
		this.setBounds(100, 50, 230, 320);
		this.setBackground(UIUtils.Color_BACK);
		this.pack();
		this.setVisible(false);
		this.setDefaultCloseOperation(3);
		this.addMouseListener(this);
		this.addMouseMotionListener(new MouseMotionListener() {
			public void mouseMoved(MouseEvent e) {
			}

			public void mouseDragged(MouseEvent e) {
				if (LingHelpListJframe.this.isVisible()) {
					int x = e.getX() - LingHelpListJframe.this.first_x;
					int y = e.getY() - LingHelpListJframe.this.first_y;
					LingHelpListJframe.this.setBounds(x + LingHelpListJframe.this.getX(), y + LingHelpListJframe.this.getY(), LingHelpListJframe.this.getWidth(), LingHelpListJframe.this.getHeight());
				}

			}
		});
	}

	public void mouseClicked(MouseEvent e) {
	}

	public void mousePressed(MouseEvent e) {
		Music.addyinxiao("关闭窗口.mp3");
		if (e.isMetaDown()) {
			FormsManagement.HideForm(622);
		} else {
			FormsManagement.Switchinglevel(622);
		}

		this.first_x = e.getX();
		this.first_y = e.getY();
	}

	public void mouseReleased(MouseEvent e) {
	}

	public void mouseEntered(MouseEvent e) {
	}

	public void mouseExited(MouseEvent e) {
	}

	public LingHelpListJpanel getLingHelpListJpanel() {
		return lingHelpListJpanel;
	}

	public void setLingHelpListJpanel(LingHelpListJpanel lingHelpListJpanel) {
		this.lingHelpListJpanel = lingHelpListJpanel;
	}
}
